function ZCImage = ZCRegister(ZCImage,tform,FixedImage,MaxTranslationStep,GpuCapacity)
%CPU: CPU+6
%GPU: CPU+0, GPU+6
[SizeX,SizeY,SizeT,SizeZC]=size(ZCImage);
RefObj=imref2d([SizeX SizeY]);
if GpuCapacity
	for T=0:GpuCapacity:SizeT-1
		Fragment=T+1:min(T+GpuCapacity,SizeT);
		ZCFragment=gpuArray(ZCImage(:,:,Fragment,:));
		for ZC=1:SizeZC
			ZCFragment(:,:,:,ZC)=imwarp(ZCFragment(:,:,:,ZC),tform(ZC),'nearest',OutputView=RefObj);
		end
		ZCImage(:,:,Fragment,:)=TTRegister(ZCFragment,FixedImage,MaxTranslationStep);
	end
else
	for ZC=1:SizeZC
		ZCImage(:,:,:,ZC)=imwarp(ZCImage(:,:,:,ZC),tform(ZC),'nearest',OutputView=RefObj);
	end
	ZCImage=TTRegister(ZCImage,FixedImage,MaxTranslationStep);
end